package main.Q1701_1800;

import java.util.ArrayList;
import java.util.List;

public class Q1781_1790 {
    public static void main(String[] args) {
        System.out.println("Question1781：");
        System.out.println("Question1782：");
        System.out.println("Question1783：");
        System.out.println("Question1784：检查二进制字符串字段");
        System.out.println("Question1785：");
        System.out.println("Question1786：");
        System.out.println("Question1787：");
        System.out.println("Question1788：");
        System.out.println("Question1789：");
        System.out.println("Question1790：仅执行一次字符串交换能否使两个字符串相等");
    }
}

class Question1784{
    public boolean checkOnesSegment(String s) {
        String[] str=s.split("0");
        int count=0;
        for (String s1:str){
            if (s1.length()>=1) count++;
            if (count>1) return false;
        }
        return true;
    }
}

class Question1790{
    public boolean areAlmostEqual(String s1, String s2) {
        char[] str1=s1.toCharArray(),str2=s2.toCharArray();
        List<Character> list1=new ArrayList<>(),list2=new ArrayList<>();
        for (int i=0;i< str2.length;i++){
            if (str1[i]!=str2[i]) {
             list1.add(str1[i]);
             list2.add(str2[i]);
            }
        }
        if (list1.size()!=0&&list1.size()!=2) return false;
        else {
            for (char c:list1){
                if (!list2.contains(c)) return false;
            }
            return true;
        }
    }
}